package com.pureut.storage.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pureut.storage.domain.CheckManagementDetail;
import com.pureut.storage.dto.CheckDetailListDto;
import com.pureut.storage.dto.CheckManagementDto;
import com.pureut.storage.dto.CheckMaterialDto;
import com.sale.common.mybatis.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * 盘点明细 Mapper
 */

@Mapper
public interface CheckManagementDetailMapper extends BaseMapperPlus<CheckManagementDetailMapper,CheckManagementDetail,CheckManagementDetail> {

    /**
     * 盘点单据明细列表
     */
    List<CheckDetailListDto> selectDetailList(String docNum);

    /**
     * 单据明细列表(分页)
     */
    Page<CheckDetailListDto> selectDetailPageList(@Param("page")Page<CheckDetailListDto> page,@Param("docNum") String docNum);

    /**
     * 查询盘点物料下拉
     * @param checkDoc
     * @return
     */
    List<CheckMaterialDto> selectMaterialList(String checkDoc);

    /**
     * 盘点单据明细列表
     * @param checkDoc
     * @return
     */
    List<CheckManagementDto> reviceDocDetail(String checkDoc);

    /**
     * 查询该库区库位下有多少库存
     * @param checkDoc
     * @param materialCode
     * @param combinationName
     * @return
     */
    String selectStockNum(@Param("checkDoc") String checkDoc, @Param("materialCode") String materialCode, @Param("combinationName") String combinationName);
}
